<?php

//coder :Nguyen Tran Minh Trung
class con_Normal {

    public $view;
    public $ahead;

    function __construct() {
        Controller::get_view();
    }

    //not nes
    function get_location() {
        $ip = $_SERVER['REMOTE_ADDR'];
        if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
            $ip = $_SERVER['HTTP_CLIENT_IP'];
        } elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
            $ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
        }
        $ip = ($ip == '127.0.0.1' ? '113.22.232.110' : $ip);
        $thong_tin = unserialize(file_get_contents('http://ip-api.com/php/' . $ip));
        print_r($thong_tin);
    }

    function get_info() {
        Controller::get_model('home');
        $home = new home();
        $this->ahead = $home->get_info_web();
        $this->ahead['css'] = array();
        $this->ahead['js'] = array();
        $this->ahead['robot'] = 1;
    }

    function welcome() {
        $this->get_info();
        $this->view = new View(DEF_URL, DEF_PATH, 'welcome', 'en', $this->ahead);
        $this->view->head();
        $this->view->get_DefView('s_bar.php');
    }

    function home() {
        $this->get_info_web();
        $this->view = new View(DEF_URL, DEF_PATH, 'default', 'en', $this->ahead);
        $this->view->head();
        $this->view->top();
        $this->search_Page(
        );
        $this->view->get_View('foot.php');
    }

    function logout() {
        session_destroy();
        echo

        "<script language=javascript> javascript:history.back();</script>";
    }

    function

    loi() {
        echo 'ss';
    }

    function admin() {
        header('loction:' . DEF_URL . '/admin');
    }

}
